package reflex;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: homechen
 * Date: 2024-03-10
 * Time: 21:50
 */
public class Student {
    private int age = 20;
    public String name = "张三";

    // 无参的构造
    public Student() {
        System.out.println("Student()!");
    }

    private Student(int age, String name) {
        this.age = age;
        this.name = name;
        System.out.println("Student(age,name)");
    }

    private void eat() {
        System.out.println("I am eat");
    }

    public void sleep() {
        System.out.println("I am sleep");
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

    private void function(String str) {
        System.out.println(str);
    }


}
